<script type="text/javascript">
function new_mail(){
	$('#new_mail').load('/index.php/comments/new_email', function(){});
}
</script>
<?php $this->load->helper('date'); ?>
<h2>Commentaires</h2>
<div id="comments_list">
<?php foreach($comments as $row){
	?>
	<div class="comment">
	<span class="title"><?=mdate("Le %d/%m/%y",mysql_to_unix($row->date))?> par <b><?=$row->username;?></b></span>
	<span class="message"><?php echo $row->comment;?></span>
	</div>
<?php 
}
?>
</div>
<div id="comment_form">
<h3>Envoyer un commentaire</h3>
<form method="post" action="/index.php/comments/send">
<input type="hidden" name="user_id" value="<?=$user_id?>" />
<input type="hidden" name="piece_id" value="<?=$piece_id?>" />
Votre commentaire : <br/><?php echo form_textarea(array('name' => 'comment', 'id' => 'comment', 'cols' => '35', 'rows' => '3'));?>
<?php echo form_submit('','Envoyer');?>
</form>
<ul class="social">
<li><a id="twitter" href="javascript:void(0);" onclick="window.open('http://twitter.com/home?status=En train d\'admirer l\'oeuvre suivante : http://www.online-expo.com/visit/view/<?=$piece_id;?>', '_blank', 'width=580px,height=250px,scrollbars=yes,status=no,resizable=yes');" value=""><font>twitter</font></a></li>
<li><a name="fb_share" type="button_count" href="http://www.facebook.com/sharer.php">Partager</a><script src="http://static.ak.fbcdn.net/connect.php/js/FB.Share" type="text/javascript"></script></li>
<li><a href="#" href="javascript:void(null);" onclick='new_mail();return false;'"><img class="icon" src="/images/email.png"/> Partager par email</a><div id="new_mail"></div></li>
</ul>
</div>
